<%@ page language="java" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>机构-酒店房间表 编辑页面</title>
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
    <jsp:include page="../com/header.jsp"></jsp:include>
    <script type="text/javascript" src="../../js/comm/editcomm.js"></script>
    <script type="text/javascript" src="insHotelRooms.js"></script>
    <script type="text/javascript">
        $(function () {
            getDataByIdInInsHotelRoomsEdit(root + 'cms/insHotelRoomsTable/findInsHotelRoomsTableById', "#insHotelRoomsTableTmpl", "#insHotelRoomsTableContent");
            $("#institutionId").val(getUrlParam("institutionId"));

            $("#saveOrupdate").click(function () {
                //轮播图
                var _imgurls = [];
                $('#insHotelRoomsTableContent').find('#imgUrls_div').find('input[name="banner"]').each(function () {
                    _imgurls.push($(this).val());
                });
                if (_imgurls.length <= 0) {
                    myAlert('房间图片不能为空');
                    return;
                }
                if ($("#isSellByCard").val() != 1) {
                    //不是按卡
                    if ($("#hotelRooms_Price_unit").val().length <= 0) {
                        myAlert('房型单位不能为空');
                        return;
                    }
                }
                saveData(root + 'cms/insHotelRoomsTable/saveInsHotelRoomsTable', 'insHotelRoomsTableList.jsp');
            });
        });
    </script>
</head>
<body>

<section>
    <div>
        <div class="col-xs-12">
            <div class="box" style="height:900px;">
                <div class="box-header">
                    <br>
                    <input type="button" value="确定" id="saveOrupdate" class="btn btn-success">
                    <button onclick="backAction('insHotelRoomsTableEdit.jsp');" class="btn btn-info">返回</button>
                </div>
                <form id="submit_form" class="form-horizontal">
                    <input type="hidden" id="institutionId" name="institutionId"/>
                    <div class="tab" id="insHotelRoomsTableContent">
                    </div>
                </form>
            </div>
        </div>
</section>
<script type="text/x-jsrender" id="insHotelRoomsTableTmpl">
			<fieldset> 
				<input type="hidden" id="tId" name="id" value="{{:id}}" />
				<div class="form-group">
        			<label class="col-md-2 control-label controls" for="formGroupInputSmall">房型名称：</label>
       				 <div class="col-md-3">
						<input type="text" placeholder="请填写房型名称" class="form-control input-sm" data-rule="required;length[0~50]" id="hotelRooms_Name" name="hotelRooms_Name" value="{{:hotelRooms_Name}}" />
					</div>
      			</div>
      		    <div class="form-group" id="isSellByCard_div">
        			<label class="col-md-2 control-label controls" for="formGroupInputSmall">是否按卡销售</label>
       				 <div class="col-md-3">
						<select class="form-control input-sm" id="isSellByCard" name="isSellByCard">
												<option value="1" {{if isSellByCard==true}}selected{{else}}{{/if}}>是</option>
												<option value="0" {{if isSellByCard==true}}{{else}}selected{{/if}}>否</option>
						</select>
					</div>
					<label class="col-md-0 control-label controls" for="formGroupInputSmall">仔细填写，一旦确定不能修改</label>
      			</div>
      			<div class="form-group"  id="bookPriceDiv" {{if isSellByCard==true}}{{else}}hidden{{/if}} >
        			<label class="col-md-2 control-label controls" for="formGroupInputSmall">预订价格：</label>
       				 <div class="col-md-3">
						<input type="text" placeholder="预订价格" class="form-control input-sm" data-rule="length[0~50];money" id="bookPrice" name="bookPrice" value="{{:bookPrice}}" />
					</div>
				</div>
				<div class="form-group">
        			<label class="col-md-2 control-label controls" for="formGroupInputSmall">房型价格：</label>
       				 <div class="col-md-3">
						<input type="text" placeholder="请填写房型单价（元）" class="form-control input-sm" data-rule="required;length[0~50];money" id="hotelRooms_Price" name="hotelRooms_Price" value="{{:hotelRooms_Price}}" />
					</div>
      			</div>

				<div class="form-group" id="imgUrls_div">
        			<label class="col-md-2 control-label controls" for="formGroupInputSmall">房间图片：</label>
					<div class="col-md-5">
						<img src="../../image/add.png"  class="add_img" style="cursor:pointer;" data-type="0">
						<img src="../../image/jian.png" class="del_img" style="cursor:pointer;" data-type="0">
					</div>
      			</div>

				<div class="form-group" id="hotelRooms_Price_unit_div" {{if isSellByCard==true}}{{else}}hidden{{/if}}>
        			<label class="col-md-2 control-label controls" for="formGroupInputSmall" >房型价格单位：</label>
       				 <div class="col-md-3">
						<%--<select class="form-control input-sm" id="hotelRooms_Price_unit" name="hotelRooms_Price_unit"  {{if hotelRooms_Price_unit}}disabled{{else}}{{/if}}>--%>
						<select class="form-control input-sm" id="hotelRooms_Price_unit" name="hotelRooms_Price_unit">
												<option value="">请选择</option>
												<option value="天" {{if hotelRooms_Price_unit=='天'}}selected{{else }}{{/if}}>天</option>
												<option value="月" {{if hotelRooms_Price_unit=='月'}}selected{{else }}{{/if}}>月</option>
												<option value="季" {{if hotelRooms_Price_unit=='季'}}selected{{else }}{{/if}}>季</option>
												<option value="年" {{if hotelRooms_Price_unit=='年'}}selected{{else }}{{/if}}>年</option>
						</select>
					</div>
      			</div>
				<div class="form-group">
        			<label class="col-md-2 control-label controls" for="formGroupInputSmall">房型：</label>
       				 <div class="col-md-3">
						<select class="form-control input-sm" id="hourseType" name="hourseType" data-rule="required">
												<option value="{{if hourseType}}{{:hourseType}}{{else }}{{/if}}">{{if hourseType}}{{:hourseType}}{{else }}请选择{{/if}}</option>
												<option value="单人间">单人间</option>
												<option value="双人间">双人间</option>
												<option value="多人间">多人间</option>
												<option value="小套">小套</option>
												<option value="中套">中套</option>
												<option value="大套">大套</option>
						</select>
					</div>
      			</div>
      			<%--<div class="form-group">--%>
        			<%--<label class="col-md-2 control-label controls" for="formGroupInputSmall">库存：</label>--%>
       				 <%--<div class="col-md-3">--%>
						<%--<input type="text" placeholder="请输入库存" class="form-control input-sm" data-rule="required;length[0~50];plus" id="hotelRooms_Inventory" name="hotelRooms_Inventory" value="{{:hotelRooms_Inventory}}" />--%>
					<%--</div>--%>
				<%--</div>--%>
      			<div class="form-group">
        			<label class="col-md-2 control-label controls" for="formGroupInputSmall">房型简介：</label>
        		    <div class="col-md-7" id="hotelRooms_Brief" name="hotelRooms_Brief" style="height:300px;">
      			</div>
			</fieldset>

</script>
</body>
</html>